﻿CREATE PROC [util].[SetDeleteJob](
	 @JobName sysname
)
AS
BEGIN
	IF EXISTS(
		SELECT *
		FROM [msdb].[dbo].[sysjobs]
		WHERE ([name] = @JobName)
	)
		BEGIN
			EXEC [msdb].[dbo].sp_delete_job @job_name = @JobName;
			PRINT @JobName + N' SQL Agent Job deleted';
		END
END